package com.chouxiaozi.rabbitmq.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description
 * @Author Administrator
 * @Date 2020/7/414:42
 * @Version 1.0
 */
@Configuration
public class DirectConfig {

    @Bean
    Queue queue(){
        return new Queue("directQueue");
    }

    /*@Bean
    DirectExchange directExchange(){
        //名字、重启后是否依然有效、长期未使用是否自动删除
        return new DirectExchange("directExchange", true, false);
    }
    @Bean
    Binding binding(){
        return BindingBuilder.bind(queue()).to(directExchange()).with("direct");
    }*/
}
